<% if (!isRoot){ %>
  <nav class="breadcrumb">
  <% for (var i=0; i<breadcrumb.length; i++) { %>
  <% if (i==breadcrumb.length-1){ %>
  <%= breadcrumb[i].name %>
  <% }else{ %>
  <a href="./<%= breadcrumb[i].url %>"> <%= breadcrumb[i].name %> &raquo; </a>
  <% } %>
  <% } %>
  </nav>
<% } %>

<% if (albums.length>0){ %>
  <div class="albums">
    <% albums.forEach(function(album){ %>
      <figure class="thumb js-thumb" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
          <% if(album.password) {%>
          <a class="js-secret-album img-wrap" data-href="./<%= album.url %>" data-tips="<%= album.passwordTips %>">
            <div class="bg-lock">
              <i class="icon-lock"></i>
            </div>
          <% } else { %>
          <a href="./<%= album.url %>" class="img-wrap">
          <% } %>
            <img class="js-image" alt="<%= album.name %>" data-src="<%= config.cdnDomain %><%= album.url %>?tn=1" src="./img/preloader.gif" itemprop="thumbnail" data-not-lz="true" />
          </a>
          <figcaption itemprop="caption description"><%= album.name %></figcaption>
      </figure>
    <% }) %>
    <% for (var i=0; i < 10; i++) {%>
      <figure class="thumb hide"></figure>
    <% } %>
  </div>
  <div tabindex="-1" class="overlay js-overlay"></div>
  <div class="dialog js-dialog">
    <form action="./233" method="post" class="js-form">
      <input class="input-lock js-input-lock" type="text" name="password" placeholder="password needed" />
      <input type="submit" value="确定" class="js-modal-yes btn-default" />
    </form>
  </div>
<% } %>

<% if (photos.length > 0){ %>
<div class="album-header">
  <h1 class="album-title"><%= name %></h1>
  <% if (description && description !== '') { %>
    <h2 class="des-title">「 <%= description %> 」</h2>
  <% } %>
</div>
<div class="photos" itemscope itemtype="http://schema.org/ImageGallery">
  <% photos.forEach(function(photo){ %>
      <figure class="thumb js-thumb js-photos-thumb" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
          <a class="img-wrap js-img-wrap" href="<%= config.cdnDomain %><%= photo.src %>" itemprop="contentUrl" data-size="<%= photo.size %>" data-curr-size="<%= photo.size %>">
            <img class="js-image" data-not-lz="true" alt="<%= photo.name %>" data-src="<%= config.cdnDomain %><%= photo.src %>?tn=1" src="./img/preloader.gif" itemprop="thumbnail"/>
          </a>
          <figcaption itemprop="caption description"><%= photo.name %></figcaption>
          <div style="display:none">
            <% if (photo.exif) {%>
              <div class="pswp__download_original js-download">
                <div class="pswp__download_btn js-download-btn">查看原图 (<%= parseInt((photo.exif.size || 0) / 1024) %>K)</div>
              </div>
              <% if (photo.exif.Model) {%>
                <p class="exif-p"><b><i class="icon-camera"></i></b><span><%= photo.exif.Model %></span></p>
              <% } %>

              <% if (photo.exif.FNumber || photo.exif.speed || photo.exif.ISO) {%>
                <p class="exif-p"><b><i class="icon-image"></i></b><span>f/<%= photo.exif.FNumber %>, <%= photo.exif.speed %>s, ISO<%= photo.exif.ISO %></span></p>
              <% } %>

              <% if (photo.exif.focalLength) {%>
                <p class="exif-p"><b><i class="icon-film"></i></b><span><%= photo.exif.focalLength %>mm</span></p>
              <% } %>

              <% if (!noDate && photo.exif.Time) {%>
                <p class="exif-p"><b><i class="icon-clock"></i></b><span><%= photo.exif.Time %></span></p>
              <% } %>
            <% } %>
            
          </div>
      </figure>
  <% }) %>
  <% for (var i=0; i < 10; i++) {%>
    <figure class="thumb hide js-photos-thumb"></figure>
  <% } %>
</div>
<% } %>

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <!--<button class="pswp__button pswp__button--share" title="Share"></button>-->


                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>